home *** CD-ROM | disk | FTP | other *** search
/ Champak 26 (Anniversary Edition) / Volume 26 [Anniversary Edition] - JOGO DISK .iso / DEPOSITO / sb_bust.swf / scripts / __Packages / Enemy2Obj.as < prev    next >
Text File  |  2006-07-26  |  5KB  |  173 lines

  1. class Enemy2Obj extends Enemy1Obj
  2. {
  3.    function Enemy2Obj(l_RefMov)
  4.    {
  5.       super(l_RefMov);
  6.       this.ComboNow = new Array(35);
  7.       this.Combos = new Array();
  8.       this.Combos.push(["PunchR",["Wait",20,30]]);
  9.       this.Combos.push(["PunchL",["Wait",20,30]]);
  10.       this.Combos.push(["PunchR",["Wait",20,30]]);
  11.       this.Combos.push(["PunchL",["Wait",20,30]]);
  12.       this.Combos.push(["SA",["Wait",25,30]]);
  13.       this.MaxHealth = 100;
  14.       this.Health = 100;
  15.       this.ChanceToParry = 80;
  16.       this.MaxNbParry = 3;
  17.       this.PunchRDammage = 5;
  18.       this.PunchLDammage = 5;
  19.       this.SADammage = 15;
  20.       this.BiKickDammage = 15;
  21.    }
  22.    function StartParryR()
  23.    {
  24.       if(this.RefMov.State._currentframe >= this.RefMov.State._totalframes)
  25.       {
  26.          this.State = "ParryR";
  27.       }
  28.    }
  29.    function ParryR()
  30.    {
  31.    }
  32.    function ParryBlocR()
  33.    {
  34.       if(this.RefMov.State._currentframe >= this.RefMov.State._totalframes)
  35.       {
  36.          this.State = "EndParryR";
  37.       }
  38.    }
  39.    function EndParryR()
  40.    {
  41.       if(this.RefMov.State._currentframe >= this.RefMov.State._totalframes)
  42.       {
  43.          this.ReturnIdle();
  44.       }
  45.    }
  46.    function StartParryL()
  47.    {
  48.       if(this.RefMov.State._currentframe >= this.RefMov.State._totalframes)
  49.       {
  50.          this.State = "ParryL";
  51.       }
  52.    }
  53.    function ParryL()
  54.    {
  55.    }
  56.    function ParryBlocL()
  57.    {
  58.       if(this.RefMov.State._currentframe >= this.RefMov.State._totalframes)
  59.       {
  60.          this.State = "EndParryL";
  61.       }
  62.    }
  63.    function EndParryL()
  64.    {
  65.       if(this.RefMov.State._currentframe >= this.RefMov.State._totalframes)
  66.       {
  67.          this.ReturnIdle();
  68.       }
  69.    }
  70.    function BiKickPt1()
  71.    {
  72.       if(this.RefMov.State._currentframe >= this.RefMov.State._totalframes)
  73.       {
  74.          this.CanBloc = false;
  75.          this.CheckHit();
  76.          this.State = "BiKickPt2";
  77.       }
  78.    }
  79.    function BiKickPt2()
  80.    {
  81.       if(this.RefMov.State._currentframe >= this.RefMov.State._totalframes)
  82.       {
  83.          this.CheckHit();
  84.          this.State = "BiKickPt3";
  85.       }
  86.    }
  87.    function BiKickPt3()
  88.    {
  89.       if(this.RefMov.State._currentframe >= this.RefMov.State._totalframes)
  90.       {
  91.          this.ReturnIdle();
  92.       }
  93.    }
  94.    function CheckControl()
  95.    {
  96.       if(this.TimeToWait > 0)
  97.       {
  98.          this.TimeToWait = this.TimeToWait - 1;
  99.       }
  100.       if(!_global.C.G_RoundOver)
  101.       {
  102.          if(!this.NoBloc and this.CanBloc)
  103.          {
  104.             var _loc3_ = this.CheckParry();
  105.          }
  106.          else
  107.          {
  108.             _loc3_ = false;
  109.             this.NoBloc = false;
  110.          }
  111.          if(_loc3_)
  112.          {
  113.             this.NbParry = this.NbParry + 1;
  114.             if(this.NbParry > this.MaxNbParry)
  115.             {
  116.                this.Ripost = true;
  117.                if(random(100) < 50)
  118.                {
  119.                   this.ActionNow = "PunchL";
  120.                   this.State = "StartPunchL";
  121.                }
  122.                else
  123.                {
  124.                   this.ActionNow = "PunchR";
  125.                   this.State = "StartPunchR";
  126.                }
  127.             }
  128.             else
  129.             {
  130.                this.CanBeHit = false;
  131.                if(_global.C.Player.ActionNow == "PunchR" or _global.C.Player.ActionNow == "KickR")
  132.                {
  133.                   this.State = "StartParryR";
  134.                }
  135.                else
  136.                {
  137.                   this.State = "StartParryL";
  138.                }
  139.             }
  140.          }
  141.          else if(this.State == "Idle")
  142.          {
  143.             if(this.ComboNow.length == 0)
  144.             {
  145.                this.ChooseCombo();
  146.             }
  147.             if(this.TimeToWait == 0)
  148.             {
  149.                this.SetAction();
  150.             }
  151.          }
  152.       }
  153.    }
  154.    function CheckHit()
  155.    {
  156.       if(_global.C.Player.CanBeHit or this.ActionNow == "SA" and (_global.C.Player.State == "ParryL" or _global.C.Player.State == "EndParryL" or _global.C.Player.State == "StartParryL"))
  157.       {
  158.          _global.C.Player.SetGetHit(this[this.ActionNow + "Dammage"]);
  159.       }
  160.       else if((_global.C.Player.ActionNow == "ParryR" or _global.C.Player.ActionNow == "ParryL") and _global.C.Player.AvoidAttack == "")
  161.       {
  162.          _global.C.Player.AvoidAttack = this.ActionNow;
  163.          _global.C.Player.PtSA += _global.C.Player.NbPtSAWin;
  164.          _global.C.Player.HaveParry = true;
  165.          if(_global.C.Player.PtSA > 100)
  166.          {
  167.             _global.C.Player.PtSA = 100;
  168.          }
  169.          _global.C._parent.Interface.PlayerSA.gotoAndStop(_global.C.Player.PtSA + 1);
  170.       }
  171.    }
  172. }
  173.